From: Florian Müllner Date: Tue, 20 Aug 2019 00:36:36 +0000 (+0200) Subject: scripting: Disable an eslint warning X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~811^2^2~69 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e585f7d97bb2fdb54656fd894297578e2a0c94d1;p=gnome-shell.git scripting: Disable an eslint warning Calling await in a loop means the asynchronous operations are run sequentially instead of in-parallel. Usually that's not what's wanted, so eslint has a rule to warn about this. However here we use async/await to handle control back to the mainloop between steps, so running operations sequentially is actually intended. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731 --- diff --git a/js/ui/scripting.js b/js/ui/scripting.js index 7a14fcf55..84c1ad183 100644 --- a/js/ui/scripting.js +++ b/js/ui/scripting.js @@ -317,7 +317,7 @@ async function runPerfScript(scriptModule, outputFile) { for (let step of scriptModule.run()) { try { - await step; + await step; // eslint-disable-line no-await-in-loop } catch (err) { log(`Script failed: ${err}\n${err.stack}`); Meta.exit(Meta.ExitCode.ERROR);